package com.bjsxt.Lambda;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;

class ConSumerImpl implements Consumer{

    @Override
    public void accept(Object o) {
        System.out.println(o);
    }
}
public class Test4 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("a");
        list.add("b");
        list.add("c");

        ConSumerImpl c= new ConSumerImpl();
        list.forEach(c);
        
        list.forEach(System.out::println);

    }
}
